package lab02.test06;

/**
 * Created by Administrator on 2017/10/15.
 */
public class Triangle {
    double one;
    double two;
    double three;
    boolean f;
    double perimeter;
    double area;

    void judgement() {
        if (one + two > three & one + three > two & two + three > one)

            System.out.println("三角形存在");

        else
            System.out.println("此三角形不存在");
    }

    double getPerimeter() {
        if (one + two > three & one + three > two & two + three > one) {
            f = true;
            return one + two + three;
        }
        else {
            f = false;
            return 0;
        }
    }
    double getArea() {
if (one + two > three & one + three > two & two + three > one) {
    f=true;
    return Math.sqrt((one+two+three)*(one+two-three)*(one+three-two)*(two+three-one))*1/4;
}
   else
       return 0;
    }


}
